import request from '@/utils/request'
// 先用全路径
// 根据编码获取枚举值名称列表
/**
 * 编码:枚举值名称
DEPARTMENT_TYPE:部门类型
FILE_TYPE:文件类型
ISSUE_STATUS:问题台账状态
ISSUE_TYPE:问题台账类型
ROAD_TYPE:道路类型
*/
export function fetchEnumList(name) {
  return request({
    url: `http://checking.fothing.com/api/oss/common/enum/${name}`,
    method: 'get'
  })
}

export function fetchChildList(departmentId) {
  return request({
    url: `http://checking.fothing.com/api/oss/department/${departmentId}/children`,
    method: 'get'
  })
}

export function deleteDepartment(departmentId) {
  return request({
    url: `http://checking.fothing.com/api/oss/department/${departmentId}`,
    method: 'delete'
  })
}

export function createDepartment(data) {
  return request({
    url: 'http://checking.fothing.com/api/oss/department',
    method: 'post',
    data
  })
}

export function updateDepartment(data) {
  return request({
    url: '/article/update',
    method: 'post',
    data
  })
}
